/**
 * @create 2022-05-16
 * @desc index
 */
const {getBaseData} = require('../utils/index')
const parser = require('@babel/parser');
const { transformFromAstSync } = require('@babel/core');

const myPlugin = require('./plugin/auto-i18n')

const {sourceCode, outputFn} = getBaseData();

const ast = parser.parse(sourceCode, {
    sourceType: 'unambiguous',
    plugins: ['jsx']
})

const {code} = transformFromAstSync(ast, sourceCode, {
    plugins: [[myPlugin]]
})

outputFn(code);